<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : listProduct.xsl
    Created on : May 1, 2013, 8:29 PM
    Author     : DIEM PHUONG
    Description:
        Purpose of transformation follows.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://xml.netbeans.org/schema/products">
    <xsl:output method="html"/>
    <xsl:template match="/" >
        <xsl:for-each select="fo:products/fo:product[fo:isShow='true']">
            <xsl:sort select="fo:productID" data-type="number" order="ascending"></xsl:sort>
            <form action="Controller" method="GET">
                <li>
                    <div>
                        <a href="#">
                            <img>
                                <xsl:attribute name="src">Pictures/<xsl:value-of select="fo:productImg"/>
                                </xsl:attribute>
                                <xsl:attribute name="alt">
                                    <xsl:value-of select="fo:productName"></xsl:value-of>
                                </xsl:attribute>
                                <xsl:attribute name="onclick">viewDetail(this)</xsl:attribute>
                            </img>
                        </a>
                    </div>
                    <div>
                        <h2>
                            <xsl:value-of select="fo:productName"></xsl:value-of>
                        </h2>
                    </div>
                    <div style="display:none">
                        <xsl:value-of select="fo:productID"></xsl:value-of>
                    </div>
                    <div>$
                        <xsl:value-of select="fo:price"></xsl:value-of>
                    </div>
                    <div>
                        <button type="button" onclick="addCart(this)" title="Add to cart"></button>
                    </div>
                </li>
            </form>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>

